<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Menu extends CI_Controller {
        
//        public function index()
//	{
//            $data['buttons'] = array("Home");  
//            $data['mytitle'] = 'Welcome to Area Manager';
//            $data['Administration'] = array("Users", "Areas", "Area Groups", "Security", "Classifieds");
//            $data['Classifieds'] = array("New", "Edit", "Delete", "Approve", "Bill");
//            $this->load->view('templates/header', $data);
//            $this->load->view('menus/mainmenu', $data);
//            $this->load->view('templates/footer');
//	}
        
        public function pagemenu( $page  = "None") {
            if ( $page == "" ) {
                $data['buttons'] = array("Home", "None", "Incidents", "Aletrs", "Classifieds", "Admin");  
                $data['mytitle'] = 'Welcome to Area Manager';
                $data['Administration'] = array("Users", "Areas", "Area Groups", "Security", "Classifieds");
                $data['Classifieds'] = array("New", "Edit", "Delete", "Approve", "Bill");
               // $data = json_encode($data1);
               // var_dump($data1);
                $this->load->view('templates/header', $data);
                $this->load->view('menus/mainmenu', $data);
                $this->load->view('templates/footer');
            } else {
                switch($page) {
                    case 'home' :
                    $data['buttons'] = array("Home", "Home", "Incidents", "Aletrs", "Classifieds", "Admin");  
                    $data['mytitle'] = 'Welcome to Area Manager';
                    $data['Administration'] = array("Users", "Areas", "Area Groups", "Security", "Classifieds");
                    $data['Classifieds'] = array("New", "Edit", "Delete", "Approve", "Bill");
                    // $data1 = array( "menu" => "Login", "url" => "login.php", "display" => "Login"  );   
                     //$data = json_encode($data1);
                   //  var_dump($data1);
                     $this->load->view('menus/mainmenu', $data);
                     break;
                 case 'news' :
                        $data['buttons'] = array("Home", "News", "Incidents", "Aletrs", "Classifieds", "Admin");  
                        $data['mytitle'] = 'Welcome to Area Manager';
                        $data['Administration'] = array("Users", "Areas", "Area Groups", "Security", "Classifieds");
                        $data['Classifieds'] = array("New", "Edit", "Delete", "Approve", "Bill");
//                     $data1 = array( "menu" => array( "button" => "Home", "url" => "", "display" => "Home" ),
//                                    "menu" => array( "button" => "Login", "url" => "login.php", "display" => "Login" ),
//                                    "menu" =>array( "button" => "Logout", "url" => "logout.php", "display" => "Logout" ));   
//                     //$data = json_encode($data1);
//                      var_dump($data1);
                     $this->load->view('menus/mainmenu', $data);
                     break;
                }   
            }
        }
}
?>
